this._a11yApplicationsSettings = new Gio.Settings({ schema: A11Y_APPLICATIONS_SCHEMA });
this._a11yApplicationsSettings.connect('changed', Lang.bind(this, this._settingsChanged));
this._settingsChanged();
+
+ this._showIdleId = 0;
},
init: function () {
return;
let time = global.get_current_time();
- if (focus instanceof Clutter.Text)
- this.Show(time);
- else
+ if (!(focus instanceof Clutter.Text)) {
this.Hide(time);
+ return;
+ }
+
+ if (!this._showIdleId)
+ this._showIdleId = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE,
+ Lang.bind(this, function() { this.Show(time); }));
},
_addKeys: function () {
return one - two;
},
+ _clearShowIdle: function() {
+ if (!this._showIdleId)
+ return;
+ GLib.source_remove(this._showIdleId);
+ this._showIdleId = 0;
+ },
+
// D-Bus methods
Show: function(timestamp) {
if (!this._enableKeyboard)
if (this._compareTimestamp(timestamp, this._timestamp) < 0)
return;
+ this._clearShowIdle();
+
if (timestamp != Clutter.CURRENT_TIME)
this._timestamp = timestamp;
this.show(Main.layoutManager.focusIndex);
if (this._compareTimestamp(timestamp, this._timestamp) < 0)
return;
+ this._clearShowIdle();
+
if (timestamp != Clutter.CURRENT_TIME)
this._timestamp = timestamp;
this.hide();